package se.hiq.wineo.client.events;

import se.hiq.wineo.shared.data.WineDescriptor;

import com.google.gwt.event.shared.GwtEvent;

public class WineListLoadedEvent extends GwtEvent<WineListLoadedEventHandler> {
	public static Type<WineListLoadedEventHandler> TYPE = new Type<WineListLoadedEventHandler>();
	
	private final WineDescriptor[] descriptors;
	
	public WineListLoadedEvent(WineDescriptor[] descriptors) {
		this.descriptors = descriptors;
	}
	
	@Override
	protected void dispatch(WineListLoadedEventHandler handler) {
		handler.onWineListLoadedEvent(descriptors);		
	}
	@Override
	public Type<WineListLoadedEventHandler> getAssociatedType() {
		return TYPE;
	}

}
